﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:styles="clr-namespace:tomenglertde.ResXManager.Styles">

  <Style x:Key="{x:Static styles:ResourceKeys.GridSplitterStyle}" TargetType="{x:Type GridSplitter}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="VerticalAlignment" Value="Stretch" />
    <Setter Property="ShowsPreview" Value="False" />
    <Setter Property="Focusable" Value="True" />
    <Setter Property="MinHeight" Value="5"/>
    <Setter Property="MinWidth" Value="5"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GridSplitter}">
          <Border Background="{TemplateBinding Background}" 
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Border.Resources>
              <Style TargetType="Ellipse">
                <Setter Property="Fill" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
                <Setter Property="Width" Value="3"/>
                <Setter Property="Height" Value="3"/>
              </Style>
              <Style TargetType="Decorator">
                <Setter Property="Width" Value="3"/>
                <Setter Property="Height" Value="3"/>
              </Style>
            </Border.Resources>
            <Grid>
              <StackPanel x:Name="Grip" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" SnapsToDevicePixels="True">
                <Ellipse />
                <Decorator />
                <Ellipse />
                <Decorator />
                <Ellipse />
                <Decorator />
                <Ellipse />
              </StackPanel>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ResizeDirection" Value="Columns">
              <Setter TargetName="Grip" Property="Orientation" Value="Vertical" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="ResizeDirection" Value="Auto"/>
                <Condition Property="VerticalAlignment" Value="Stretch"/>
              </MultiTrigger.Conditions>
              <Setter TargetName="Grip" Property="Orientation" Value="Vertical" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True"/>
                <Condition Property="IsEnabled" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
            </MultiTrigger>
            <Trigger Property="IsFocused" Value="True">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" Value="0.4"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>